<div class="main_body" id="main_body">
    <div class="breadcrub">
        当前位置：文章管理>文章列表
    </div>
    <div class="pannel">
        <span class="sel_label">请选择文章分类：</span>
        <form id="form" method="get" action="/admin/index">
            <select name="select" id="select" class="sel_opt">
                {{range .types}}
                    {{if compare $.typeName .Name}}
                        <option selected="true">{{.Name}}</option>
                    {{else}}
                        <option>{{.Name}}</option>
                    {{end}}
                {{end}}
            </select>
            <input type="submit" hidden="hidden">
        </form>

        <table class="common_table">
            <tr>
                <th width="31%">商品标题</th>
                <th width="5%">商品描述</th>
                <th width="16%">添加时间</th>
                <th width="7%">库存量</th>
                <th width="10%">商品类型</th>
                <th width="10%">商品价格</th>
                <th width="7">销量</th>
                <th width="7%">删除</th>
                <th width="7%">编辑</th>

            </tr>
            {{range $index ,$val := .goods}}

                <tr>
                    <td>{{$val.Name}}</td>
                    <td><a href="/Article/ArticleContent?id={{$val.Id}}">查看详情</a></td>
                    <td> {{$val.Time.Format "2006-01-02 15:04:05"}}</td>
                    <td>{{$val.Stock}}</td>
                    <td>{{$val.GoodsType.Name}}</td>
                    <td>{{$val.Price}}</td>
                    <td>{{$val.Sales}}</td>
                    <td><a href="/Article/DeleteArticle?id={{$val.Id}}" class="dels">删除</a></td>
                    <td><a href="/Article/UpdateArticle?id={{$val.Id}}">编辑</a></td>

                </tr>
            {{end}}
        </table>

        <ul class="pagenation">
            <li><a href="/admin/index?page=1&select={{.typeName}}">首页</a></li>
            {{if compare .FirstPage true}}
                <li>上一页</li>
            {{else}}
                <li><a href="/admin/index?page={{.pageIndex | ShowPrePage}}&select={{.typeName}}">上一页</a>
                </li>
            {{end}}
            {{if compare .EndPage true}}
                <li>下一页</li>
            {{else}}
                <li><a href="/admin/index?page={{ShowNextPage .pageIndex .pageCount}}&select={{.typeName}}">下一页</a>
                </li>
            {{end}}
            <li><a href="/admin/index?page={{.pageCount}}" &select={{.typeName}}>末页</a></li>
            <li>共{{.count}}条记录/共{{.pageCount}}页/当前{{.pageIndex}}页</li>
        </ul>
    </div>
</div>
